home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Games Collection 1 / software vault.zip / software vault / CDR02 / DCGAMES1.ZIP / NEWGAME.ZIP / BARTENDE.SCR next >
Text File  |  1993-04-01  |  4KB  |  181 lines

  1. !
  2. ! Default bartender script..
  3. !
  4. ! (c) DC Software, 1992
  5. !
  6. ! Pending Enhancements
  7. !
  8. ! - This script has no voices.  For an example of voices, look at
  9. !   MERCHANT.SCR and HEALER.SCR
  10. !   
  11.  
  12. !------------------------------------------------------------------------!
  13. :@TALK ! Talk to the character !
  14. !------------------------------------------------------------------------!
  15.  
  16. ! First, say hello.. !
  17.   if NPC.V0 > 0 then
  18.     writeln( "Hello ", player.name, ". What brings you back?" );
  19.   else
  20.     writeln( "Welcome to ", npc.name, ". How may I help you?" );
  21.   endif;
  22.  
  23. ! NowF, set some variables..
  24.   NPC.V0 = 1;             ! From know on, remember we've been here
  25.   L1 = 0;                 ! No business transactions have taken place
  26.   L4 = npc.value / 5 + 1; ! Standard Tip Amount !
  27.  
  28. :LOOP
  29.  
  30.   L3 = select$( "Buy Drink",    npc.value,
  31.                 "Give Tip",     L4,
  32.                 "Talk",         -1 );
  33.  
  34.   ON L3 GOTO DRINK,TIP,XTALK;
  35.  
  36. :CSTOP
  37.   if L1 = 0 THEN
  38.     writeln( "Hasta la vista, baby." );
  39.   else
  40.     writeln( "It's been a pleasure doing business with you!" );
  41.   endif;
  42.   STOP;
  43.  
  44. !
  45. ! Drink
  46. !
  47. :DRINK
  48.  
  49.   if group.gold < npc.value GOTO BROKE;
  50.  
  51.   dec( group.gold, npc.value );
  52.   ON L1 GOTO DRINK1, DRINK2, DRINK3, DRINK4;
  53.  
  54.   writeln( "No more beer for you.." );
  55.   GOTO LOOP;
  56.  
  57. :DRINK1
  58.   writeln( ">Ahhh.. That really hit the spot.." );
  59.   inc(L1);
  60.   goto LOOP;
  61.  
  62. :DRINK2
  63.   writeln( ">Excellent brew, yes sir.." );
  64.   inc(L1);
  65.   goto LOOP;
  66.  
  67. :DRINK3
  68.   writeln( ">Glugh, glugh, glugh, hic!" );
  69.   inc(L1);
  70.   goto LOOP;
  71.  
  72. :DRINK4
  73.   writeln( ">Glugh, glugh, burp!  Sorry.." );
  74.   inc(L1);
  75.   if random(2) then     ! 50 % chance of getting sick..
  76.     player.poisoned = 1;
  77.     writeln( "(You feel sick..)" );
  78.   endif;
  79.   goto LOOP;
  80.  
  81. !
  82. ! Give TIP
  83. !
  84. :TIP
  85.  
  86.   if group.gold < L4 GOTO BROKE;
  87.  
  88.   dec( group.gold, L4 );
  89.  
  90.   ON L1 GOTO TIP1, TIP2, TIP3, TIP4, TIP5;
  91.  
  92. :TIP1
  93.   writeln( ">Heard any good ones lately?" );
  94.   writeln( "(the bartender ignores you..)" );
  95.   inc( group.gold, L4 );
  96.   goto LOOP;
  97.  
  98. :TIP2
  99.   writeln( ">It's pretty slow around here.." );
  100.   writeln( "It's the weather.. You'll get used to it.." );
  101.   goto LOOP;
  102.  
  103. :TIP3
  104.   loadhint;   ! Loads a random hint into a string variable !
  105.   writeln( S0 );
  106.   goto LOOP;
  107.  
  108. :TIP4
  109.   writeln( ">Heard any good.. Hic!.." );
  110.   writeln( "You're drunk.. You should leave now." );
  111.   goto LOOP;
  112.  
  113. :TIP5
  114.   writeln( ">Hic! 'scuse me.. Hic! Burp!" );
  115.   writeln( "No drunks allowed on the premises.." );
  116.   STOP;
  117.  
  118. :BROKE
  119.   writeln( "You don't have enough money!");
  120.   goto LOOP;
  121.  
  122. !
  123. ! Conversation
  124. !
  125. :XTALK
  126.   on L1 GOTO TALK1, TALK2, CHAT;
  127.  
  128.   writeln( ">Hic! Hic! Burp! 'Scuse me.. Hic!" );
  129.   writeln( "You'd better watch your drinking buddy.." );
  130.   goto LOOP;
  131.  
  132. :TALK1
  133.   writeln( "Does this look like a social club?" );
  134.   goto LOOP;
  135.  
  136. :TALK2
  137.   writeln( "I'm busy.  Ask me again later.." );
  138.   goto LOOP;
  139.  
  140. :CHAT
  141.   writeln( "What would you like to talk about?" );
  142.  
  143. :CHAT1
  144.   L3 = getstr("Name","Beer","Tip","Job","Bye");
  145.   if L3 = -1 then 
  146.     writeln( "Ok." );
  147.     goto LOOP; ! Pressed ESCape !
  148.   endif;
  149.  
  150. ! First, see if the keyword typed is in the character's text block !
  151.   if dotext( S0 ) goto CHAT1;
  152.  
  153. ! It didn't, so try the predefined ones..
  154.   on L3 goto CNAME, CBEER, CTIP, CJOB, CSTOP;
  155.  
  156. ! Nope, try a 'DEFAULT' line
  157.   if not dotext( "DEFAULT" ) then
  158.     ! didn't have 'default' in the text block, so give standard default !
  159.     writeln( "I don't know anything about that!" );
  160.   endif;
  161.   goto CHAT1;
  162.  
  163. :CNAME
  164.    writeln( "My name is ", NPC.name, "." );
  165.    GOTO CHAT1;
  166.  
  167. :CBEER
  168.    writeln( "A beer sells for ", $npc.value, " the pretzels are free." );
  169.    GOTO CHAT1;
  170.  
  171. :CTIP
  172.    writeln( "Most people give ", $L4 );
  173.    GOTO CHAT1;
  174.  
  175. :CJOB
  176.    writeln( "I sell {beer}!" );
  177.    GOTO CHAT1;
  178.  
  179. ! Feel free to expand on this list.. !
  180.  
  181.